home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DllSys_Files / GAMAXON / GAMMAA.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.5 KB  |  45 lines

  1. // Dynamic link library implementation of NeuroSolutions GammaAxon component 
  2.  
  3. #include "NSDLL.h"
  4.  
  5. /***********************************/
  6. /* Forward activation of component */
  7.  
  8. __declspec(dllexport) void performGammaAxon(
  9.     DLLData *instance,    // Pointer to instance data (may be NULL)
  10.     NSFloat    *data,         // Pointer to the layers of processing elements (PEs), one for each memory tap
  11.     int     rows,        // Number of rows of PEs in the layer
  12.     int     cols,        // Number of columns of PEs in the layer
  13.     NSFloat    *delayedData,     // Pointer to a PE layer delayed by a user defined time step
  14.     int     taps,        // Number of memory taps specified by the user in the inspector
  15.     NSFloat    *gamma         // Pointer to vector of gamma coefficients, one for each channel
  16.     )
  17. {
  18.     register int i,j,k,length=rows*cols;
  19.  
  20.     for (i=0; i<length; i++)
  21.         for (j=1; j<taps; j++) {
  22.             k = i + j*length;
  23.             data[k] = gamma[i]*delayedData[k-length] + (1-gamma[i])*delayedData[k];
  24.         }  
  25. }
  26.  
  27. /******************************************/
  28. /* Management of instance data (OPTIONAL) */
  29. /*
  30. __declspec(dllexport) DLLData *allocGammaAxon(
  31.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  32.     int     rows,        // Number of rows of PEs in the layer
  33.     int     cols,        // Number of columns of PEs in the layer
  34.     int     taps        // Number of taps attached to each PE
  35.     )
  36. {
  37.     DLLData *instance = allocDLLInstance(oldInstance);
  38.     return instance;
  39. }
  40.  
  41. __declspec(dllexport) void freeGammaAxon(DLLData *instance)
  42. {
  43.     freeDLLInstance(instance);
  44. }
  45. */